Skip to content

Re-implement request body previews on Android#55456

Closed
huntie wants to merge 2 commits into
react:mainfrom
huntie:export-D89381124
Closed

Re-implement request body previews on Android#55456
huntie wants to merge 2 commits into
react:mainfrom
huntie:export-D89381124

Conversation

@huntie

@huntie huntie commented Feb 6, 2026

Copy link
Copy Markdown
Member

Summary:
Context

Follow-up to #54917, which addressed a runtime Android crash with FormData uploads (#54881) but introduced a "[Preview unavailable]" fallback for the ProgressRequestBody case.

This diff

Reintroduce request body previews under this case.

Protects agains the original crash by:

  • Checking body.isOneShot() to prevent disallowed double-reads of stream bodies.
  • [Pre-existing] Preserves BuildConfig.DEBUG guard added in D89377163.

Changelog:
[Android][Added] - React Native DevTools: Restore request payload previews on Android

Differential Revision: D89381124

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2026
@meta-codesync

meta-codesync Bot commented Feb 6, 2026

Copy link
Copy Markdown

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89381124.

Summary:
Follows #55706.

Updates the signature of `onCreateRequest`, and removes legacy `onCreateRequest` and `onResponseReceived` overloads — effectively de-OkHttp-ing this internal API.

Changelog: [Internal]

Differential Revision: D94510863
@huntie huntie force-pushed the export-D89381124 branch 2 times, most recently from 330c229 to 6959187 Compare February 26, 2026 14:17
Summary:
Pull Request resolved: #55456

**Context**

Follow-up to D89373824, which addressed a runtime Android crash with `FormData` uploads (#54881) but introduced a "[Preview unavailable]" fallback for the `ProgressRequestBody` case.

**This diff**

Reintroduce request body previews under this case.

Protects agains the original crash by:

- Checking `body.isOneShot()` to prevent disallowed double-reads of stream bodies.
- [Pre-existing] Preserves `BuildConfig.DEBUG` guard added in D89377163.

Changelog:
[Android][Added] - React Native DevTools: Restore request payload previews on Android

Differential Revision: D89381124
@meta-codesync meta-codesync Bot closed this in cc44e96 Feb 27, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 27, 2026
@meta-codesync

meta-codesync Bot commented Feb 27, 2026

Copy link
Copy Markdown

This pull request has been merged in cc44e96.

@huntie huntie deleted the export-D89381124 branch March 2, 2026 09:58
meta-codesync Bot pushed a commit that referenced this pull request Apr 10, 2026
Summary:
So  the formData Upload in fetch is broken on 0.85 on main.
I tracked down this PR #55456
Also reported here #56404
RCA:-
```
body.isOneShot()
body.writeTo(buffer)  // This is  draining inner file InputStreams
```
Fix is to walk to each children of multipart and check for Oneshot
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID][FIXED] - FormData uploads broken in debug builds

Pull Request resolved: #56406

Test Plan:
Tested on RN tester
<img width="416" height="600" alt="image" src="https://github.com/user-attachments/assets/20cae662-e2ba-4fc7-9f8d-d8e365eb95b2" />

Reviewed By: fabriziocucci, huntie

Differential Revision: D100258994

Pulled By: alanleedev

fbshipit-source-id: aeda47d45db2152027598c949f0e602a586c4cb3
react-native-bot pushed a commit that referenced this pull request Apr 13, 2026
Summary:
So  the formData Upload in fetch is broken on 0.85 on main.
I tracked down this PR #55456
Also reported here #56404
RCA:-
```
body.isOneShot()
body.writeTo(buffer)  // This is  draining inner file InputStreams
```
Fix is to walk to each children of multipart and check for Oneshot
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID][FIXED] - FormData uploads broken in debug builds

Pull Request resolved: #56406

Test Plan:
Tested on RN tester
<img width="416" height="600" alt="image" src="https://github.com/user-attachments/assets/20cae662-e2ba-4fc7-9f8d-d8e365eb95b2" />

Reviewed By: fabriziocucci, huntie

Differential Revision: D100258994

Pulled By: alanleedev

fbshipit-source-id: aeda47d45db2152027598c949f0e602a586c4cb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants